Skip to content

Add versioned template routes and revision selector - #42

Merged
pixelcmtd merged 1 commit into
precens-91from
t3code/review-versioned-template-route
Sep 8, 2026
Merged

Add versioned template routes and revision selector#42
pixelcmtd merged 1 commit into
precens-91from
t3code/review-versioned-template-route

Conversation

@CMJanina

@CMJanina CMJanina commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Add the versioned template route and dropdown from the first item in #39. /internal/templates/[id]/ shows the latest revision, while /internal/templates/[id]/[rev]/ selects a specific revision. The dropdown follows procens with a latest option and a Versions group.

getTemplateVersion now treats omitted, null, and empty revisions as latest, replacing getCurrentTemplate. check.save rejects empty revisions so saved Checks remain pinned to a revision.

Validation: all 22 tests and the build pass. Checked latest and explicit revision routes, dropdown selection, unknown-revision 404, and empty-revision save rejection.

@CMJanina
CMJanina force-pushed the t3code/review-versioned-template-route branch from c970b59 to 8910a22 Compare September 8, 2026 16:53
@CMJanina
CMJanina changed the base branch from daddy to precens-91 September 8, 2026 16:53
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

🔄 Force-push range-diff

c970b592205a8910a226e698

Show range-diff
-:  ------- > 1:  5787112 show created_at on check pages (#40)
-:  ------- > 2:  b6d1e86 rewind: make card values directly editable, remove settings inputs
-:  ------- > 3:  80c2781 rewind: collapse component into a pure astro page
-:  ------- > 4:  7500bd1 rewind: factor shared text-align, drop redundant width on flex items
-:  ------- > 5:  fa338fb rewind: add hint that values are click-to-edit
-:  ------- > 6:  e554f7d Test template collection integrity (#41)
1:  c970b59 ! 7:  8910a22 Add versioned template routes and revision selector
    @@ test/templates.test.ts: import { getCollection } from "astro:content";
      import { readdir } from "node:fs/promises";
      
      test("every template directory has tMeta metadata and vice versa", async () => {
    -@@ test/templates.test.ts: test("every template directory has tMeta metadata and vice versa", async () => {
    - });
    - 
    - const templates: template[] = await getCollection("templates").then(x => x.map(t => t.data));
    -+assert(templates.length > 0, "templates must be loaded");
    - 
    - for (const t of templates) {
    -     test(`${t.id} revisions are unique`, () => {
     @@ test/templates.test.ts: test("kink ids are unique", () => {
              }
          }

@pixelcmtd
pixelcmtd merged commit 10b2457 into precens-91 Sep 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants